package strategy.a;

public class CashReturn extends CashSuper {

	private double moneyCondition;
	
	private double moneyReturn;
	
	public CashReturn(double moneyCondition, double moneyReturn) {
		super();
		this.moneyCondition = moneyCondition;
		this.moneyReturn = moneyReturn;
	}

	@Override
	public double acceptCash(double cash) {
		
		double result = cash;
		
		if (cash >= moneyCondition) {
			result = cash - moneyReturn;
		}
		
		return result;
	}

}
